package cn.edu.scau.cmi.yangzhengkai.composite.safe;

import java.util.HashSet;
import java.util.Set;

public class SafeLeaf extends SafeComponent{
	
	private String name;
	private SafeComponent parent;
	
	
	public SafeLeaf() {
	}
	
	
	public SafeLeaf(String name, SafeComponent parent) {
		
		this.name = name;
		this.parent = parent;
	}
	
	@Override
	public String dosomething() {
		return "this is Safe Leaf";
	}

	
	@Override
	public SafeComponent getParent() {
		return parent;
	}
	
	
	
	@Override
	public String toString() {
		
		return this.name;
	}

}
